home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Grafik / Misc / ImageEnginer / ARexx / Solarize.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-01-28  |  1.6 KB  |  74 lines

  1. /*
  2. ** $VER: Solarize 2.1, IE Arexx script
  3. ** Image Engineer Macro script
  4. ** by Simon Edwards
  5. ** 6/7/96
  6. ** Modified by Patrik M Nydensten
  7. ** 24/1 1997 Stockholm/Sweden
  8. **
  9. ** 18/1 FORM interface added. SBE
  10. **
  11. ** Applies a solarize effect to the image.
  12. */
  13.  
  14. Options results
  15. signal on error         /* Setup a place for errors to go */
  16.  
  17. if arg()==0 then exit
  18.  
  19. 'FORM "Solarize" "Ok|Cancel"',
  20. ' RADIO,"Type","Standard|Pg standard|Pg inverse",0'
  21.  
  22. if word(result,1)=0 then exit
  23.  
  24. Type = word(result,2)
  25.  
  26. 'NEGATIVE' arg(1)
  27. NegImage=RESULT
  28.  
  29. select
  30.   when Type = 0 then do
  31.     'MARK' arg(1) 'PRIMARY'
  32.     'MARK' NegImage 'SECONDARY'
  33.     'COMPOSITE' 0 0 'MAX'
  34.   end
  35.   when Type = 1 then do
  36.     'MARK' arg(1) 'SECONDARY'
  37.     'MARK' NegImage 'PRIMARY'
  38.     'COMPOSITE' 0 0 'DIFFERENCE'
  39.     DiffImage = Result
  40.  
  41.     'NEGATIVE' DiffImage
  42.     'CLOSE' DiffImage
  43.   end
  44.   when Type = 2 then do
  45.     'MARK' arg(1) 'SECONDARY'
  46.     'MARK' NegImage 'PRIMARY'
  47.     'COMPOSITE' 0 0 'DIFFERENCE'
  48.   end
  49.   otherwise exit
  50. end /* select */
  51.  
  52. 'CLOSE' NegImage
  53.  
  54. exit
  55.  
  56. /*******************************************************************/
  57. /* This is where control goes when an error code is returned by IE */
  58. /* It puts up a message saying what happened and on which line     */
  59. /*******************************************************************/
  60. error:
  61. if RC=5 then do         /* Did the user just cancel us? */
  62.     IE_TO_FRONT
  63.     LAST_ERROR
  64.     'REQUEST "'||RESULT||'"'
  65.     exit
  66. end
  67. else do
  68.     IE_TO_FRONT
  69.     LAST_ERROR
  70.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  71.     exit
  72. end
  73.  
  74.